<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <h2>使用可选参数，回调函数</h2>
    <p id="demo"></p>
    <script>
        debugger
        JSON.parse('{"p": 5}', function (k, v) {
            if (k === '') { return v; }
            return v * 2;
        });
        JSON.parse('{"1": 1, "2": 2, "3": {"4": 4, "5": {"6": 6}}}', function (k, v) {
            document.write(k);// 输出当前属性，最后一个为 ""
            document.write("<br>");
            return v;       // 返回修改的值
        });
    </script>
</body>

</html>